Conversation
Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>
|
Does this PR break the axiom that 1 test = 1 request? Or has that already been broken? What is the goal with this change? To reduce duplication? How useful would this be in practice? E.g. do we have lots of tests that would then become 1 single test? I may be misunderstanding this change, but it looks like a very significant change. |
|
Sorry, forgot to add the reference to coreruleset/go-ftw#256. This makes sense mostly for exclusion rules in plugins, where we need to test many URLs are not matching certain rules. |
Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>
| // examples: | ||
| // - name: URI | ||
| // value: "\"/get?hello=world\"" | ||
| // value: '/get?hello=world" |
There was a problem hiding this comment.
| // value: '/get?hello=world" | |
| // value: '/get?hello=world' |
|
|
||
| // description: | | ||
| // URIs is a list of URIs that the test should use as part of the request line. | ||
| // If URIs is set, URI will be ignored. URIs is useful for tests that need to send multiple requests. |
There was a problem hiding this comment.
| // If URIs is set, URI will be ignored. URIs is useful for tests that need to send multiple requests. | |
| // If URIs is set, URI will be ignored. URIs is useful for running the same test against multiple URIs, e.g., when | |
| // matching on URI paths. |
That was never the case, technically, since even the old framework supported "stages".
Yes, mainly. For example, when testing rule exclusions, you often need to test multiple URI paths, while all other test data remains the same.
Yes, most notably in plugins.
No, it should be straight forward and is backwards compatible. |
|
While poring over the unix RCE FPs, I had a thought. Instead of making # ...
templates:
- key: uri
values:
- /get
- /get?foo=bar
- key: command
values:
- php
- php%20foo
# ...
input:
uri: "{{ uri }}"
method: POST
data: "cmd={{ command }}"The set of tests would be the cross product of all combinations. We could maybe distinguish these "template tests" from existing tests by introducing a new "template test" type. What do you think? |
|
You are getting nearer a vision I had this retreat about how the future will look like for writing a rule. It definitely implies adding templating. Also, 99% of our tests only need one template. We tend to repeat 90% of the text we do in tests. I plan to write a blog post about this, but will take me some time to process when heading back tomorrow. Another good source of inspiration could be... nuclei templates. |
what
URIsas a new fieldwhy